#!/bin/bash

REPO_DIR=$(pwd)
COMMIT_MSG="Auto-committing changes"

# Ensure you're in a git repository
if [ ! -d .git ]; then
    echo "This script should be run from within a Git repository."
    exit 1
fi

# Watch for modifications in all files within the directory
fswatch -o "$REPO_DIR" | while read
do
    git add .
    git commit -m "$COMMIT_MSG"
    git push
done


